<%@tag pageEncoding="UTF-8" %>
<%@ attribute name="value" type="java.lang.String" required="true" %>
<%@ attribute name="length" type="java.lang.Integer" required="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    //默认长度为30
    length = (length == null || length <= 0) ? 30 : length;
    String out_value = value;
    if (value.length() > length) {
        out_value = value.substring(0, length);
        out_value = out_value + "...";
    }
    out.print(out_value);
    out.flush();
%>